package com.ljx.funchat.chat.dao;

import com.ljx.funchat.chat.domain.entity.RoomGroup;
import com.ljx.funchat.chat.mapper.RoomGroupMapper;
import com.ljx.funchat.chat.service.IRoomGroupService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author LiJunXi
 * @since 2024-02-14
 */
@Service
public class RoomGroupDao extends ServiceImpl<RoomGroupMapper, RoomGroup> {

    public RoomGroup getByRoomId(Long id) {
        return lambdaQuery().eq(RoomGroup::getRoomId, id).one();
    }

    public List<RoomGroup> listByRoomIds(List<Long> roomIds) {
        return lambdaQuery().in(RoomGroup::getRoomId, roomIds).list();
    }
}
